// 引入
import Vue from 'vue' ;
import VueRouter from 'vue-router';

// 引入app
import App from './app.vue';

// 引入404
import NotFound from './notFound.vue';
// 引入home
import Home from './home.vue';

// 安装插件
Vue.use(VueRouter);

// 配置路由
let router  = new VueRouter();
router.addRoutes([
    // 重定向
    // {path:'/', redirect:'/home'},
    {path:'/', redirect:{name:'home'}},
    {name:'home', path:'/home', component:Home},
    {path:'/notFound', component:NotFound},
    // 404
    {path:'*', component:NotFound}
]);

new Vue(
    {
        el: '#app',
        router,
        render(c){
            return c(App);
        }
    }
);